<template>
	<view>
		<view class="lunbo">
			<swiper :interval="3000" :duration="1000" :indicator-dots="false" :current="topSwiperIndex"@change="topSwiperTab">
				<swiper-item v-for="(item,index) in topSwiper" :key="index">
					<view class="swiper-item">
						<image class="image" :src="item.src" mode="aspectFill"></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="anniu">
			<navigator open-type="switchTab" url="../baojing/first"><button class="anniu1" >
					<image src="../../static/报警,警报,报警灯,危险.png" style="width: 50px; height: 50px;">
						<view>报警</view>
					</image>
				</button></navigator>
			<button class="anniu2" @click="cell()">
				<image src="../../static/一键报警.png" style="width: 50px; height: 50px;">
					<view>一键报警</view>
				</image>
			</button>
			<navigator open-type="navigate" url="../record/record"><button class="anniu1">
				<image src="../../static/历史记录.png" style="width: 50px; height: 50px;">
					<view>报警历史</view>
				</image>
			</button></navigator>
		</view>
		<view class="anniu">
			<navigator open-type="switchTab" url="../test/first"><button class="anniu1">
				<image src="../../static/考试2.png" style="width: 50px; height: 50px;">
					<view>安全考试</view>
				</image>
			</button></navigator>
			<navigator open-type="switchTab" url="../information/first"><button class="anniu2">
				<image src="../../static/个人中心.png" style="width: 50px; height: 50px;">
					<view>个人中心</view>
				</image>
			</button></navigator>
			<navigator open-type="switchTab" url="../news/first"><button class="anniu1">
				<image src="../../static/安全.png" style="width: 50px; height: 50px;">
					<view>公安安全</view>
				</image>
			</button></navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				topSwiperIndex: 0,
				topSwiper: [{
						src: require('../../static/首页轮播图/轮播图1.jpeg')
					},
					{
						src: require('../../static/首页轮播图/轮播图2.jpeg')
					},
					{
						src: require('../../static/首页轮播图/轮播图3.jpeg')
					},
				],

			}

		},
		methods: {
			topSwiperTab(e) {
				var that = this;
				this.topSwiperIndex = Number(e.target.current);
			},
			cell(){
				wx.makePhoneCall({
				  phoneNumber: '110' // 仅为示例，并非真实的电话号码
				})
			}
	
		},
	}
</script>

<style >
	.lunbo{
	}
	.swiper-item{
		width: 750rpx;
		height: 700rpx;
		}
	.image{
		width: 100%;

	}
	.anniu {
		display: flex;
	}

	.anniu1 {
		height: 250rpx;
		width: 250rpx;
		background: #ffffff;
		
	}

	.anniu2 {
		height: 250rpx;
		width: 250rpx;
		background: #ffffff;
	}
</style>
